class Employee < ApplicationRecord

  has_many :companies, class_name: "Company", primary_key: "emp_code", foreign_key: "followup_employee_code", dependent: :nullify
  has_many :followup_records, class_name: "FollowupRecord", primary_key: "emp_code", foreign_key: "followup_employee_code"
  has_many :created_followup_records, class_name: "FollowupRecord",  primary_key: "emp_code", foreign_key: "creator_id"

  default_scope { where("is_delete = 0") }
  
end
